﻿@using Webdiyer.WebControls.Mvc;
@model Webdiyer.WebControls.Mvc.PagedList<BaseData.Model.Station>
@{
    var idx = 0;
    var txt = "";
}

<table class="table table-striped">
    <tr>
        <th>
            序号
        </th>
        <th>
            编号
        </th>
        <th>
            名称
        </th>
        <th>
            部门
        </th>
        <th>
            项目
        </th>
        <th>
            状态
        </th>
        <th>
            操作
        </th>
    </tr>
    @foreach (var item in Model)
    {
        idx++;
        <tr>
            <td>
                @idx
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.StationID)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.StationName)

            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Department.DepartmentName)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Department.Project.ProjectName)
            </td>
            <td>
                @if (item.Status == 0)
                {
                    txt = "未分配";
                }
                else
                {
                    txt = "已分配";
                }
                @txt
            </td>
            <td>
                <a title="编辑" href="javascript:Edit('@item.StationID');"><span class=" glyphicon glyphicon-edit"></span></a>
                &nbsp;&nbsp;
                <a title="删除" href="javascript:Delete('@item.StationID')"><span class="glyphicon glyphicon-trash"></span></a>
            </td>
        </tr>
    }
</table>
<hr />
<div style="padding-top:5px; width:100%">
    <div style="float:left">共 @Model.TotalPageCount 页 @Model.TotalItemCount 条记录，当前为第 @Model.CurrentPageIndex 页</div>
    @Ajax.Pager(Model, new PagerOptions { PageIndexParameterName = "id", ShowPageIndexBox = true, PageIndexBoxType = PageIndexBoxType.DropDownList, ShowGoButton = false }, new MvcAjaxOptions { UpdateTargetId = "station", DataFormId = "searchForm" }, new { style = "float:right" })
</div>
